<?php 
session_start();
$userid=null;
if (isset($_SESSION["userid"])==false || $_SESSION["userid"]==null) {
	header("Location: index.php");
	exit;
} else {
	$userid = $_SESSION["userid"];
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>YuHu - My Travel Agent</title>

<script type="text/javascript" src="./js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="./js/jquery-ui-1.7.2.custom.min.js"></script>

<link href="./css/cupertino/jquery-ui-1.7.2.custom2.css" rel="stylesheet" type="text/css" />
<link href="./css/style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
	$(function() {
		$(".accordion").accordion({
		    collapsible: true,
		    autoHeight: false
			});
		$('.myDatePicker_tour').datepicker({
			numberOfMonths: 2,
			showButtonPanel: true
		});
		$(".tabs").tabs();
		
	});

	function newTourSubmit() {
		tour_name = $("#tour_name").val();
		tour_startdate = $("#tour_startdate").val();
		tour_enddate = $("#tour_enddate").val();
		tour_people = $("#tour_people").val();
		tour_description = $("#tour_description").val();
		//tour_style = $("#tour_style").val();
		//tour_location = $("#tour_location").val();
		//alert(tour_name + "/" + tour_startdate + "/" + tour_enddate + "/" + tour_people + "/" + tour_description );

		// Process New Tour
		$.post("main_new_tour_process.php", {
			tour_name : $("#tour_name").val(),
			tour_startdate : $("#tour_startdate").val(),
			tour_enddate : $("#tour_enddate").val(),
			tour_people : $("#tour_people").val(),
			tour_description : $("#tour_description").val()
			//tour_style : $("#tour_style").val(),
			//tour_location : $("#tour_location").val()			
		},
		function(data){
			indexTour = data;
	    //Load title

			$.post("main_load_title.php", {
				indexTour: data
			},
			function(data2){
				$("#MainTitle").html(data2);
			}
			);//end

			//Load tab and form
			$.post("main_load_tabs.php", {
				indexTour : data
			},
			function(data3){
				$("#MainTabAreaDiv").html(data3);
				$("#MainTabArea").tabs();
				$('.myDatePicker_tour').datepicker({
					numberOfMonths: 2,
					showButtonPanel: true
				});
				$(".accordion").accordion({
				    collapsible: true,
				    autoHeight: false
					});
			}
			);//End

		}
		);

	}
	</script>

</head>
<body>
<!--Main Area ----------------------------------------------------------------------------  -->
<div id="MainTitle" class="MainTitle">
Tip :: Create your own tour.
</div>
<div id="MainTabAreaDiv">
<div id="MainTabArea" class="tabs">
		<ul>
			<li><a href="#tabs-tour">Create Your Tour</a></li>
			<!--<li><a href="#tabs-details">Details</a></li>  -->
		</ul>
		<div id="tabs-tour">
			<table>
				<tr><td>Tour Name:</td><td><input type="text" name="tour_name" id="tour_name" style="width:30em;" /></td></tr>
				<tr><td>Start on:</td><td><input type="text" class="myDatePicker_tour" name="tour_startdate" id="tour_startdate" /></td></tr>
				<tr><td>End on:</td><td><input type="text" class="myDatePicker_tour" name="tour_enddate" id="tour_enddate" /></td></tr>
				<tr><td>People:</td><td><input type="text" name="tour_people" id="tour_people" /></td></tr>
				<tr><td>Description:</td><td><textarea rows="5" cols="45" name="tour_description" id="tour_description" ></textarea></td></tr>
				<tr><td> </td><td><input type="button" name="newTourSubmit" id="newTourSubmit" value="add" onclick="newTourSubmit()" /></td></tr>
			</table>		
		</div>
		<!--<div id="tabs-details">
		
		</div> -->
</div>
</div>


<!--Main Area ----------------------------------------------------------------------------  -->	
</body>
</html>

